<template>
  <view class="content">
    <u-notice-bar
      mode="vertical"
      :list="newsList"
      font-size="24"
      volume-size="26"
    ></u-notice-bar>
  </view>
</template>

<script>
export default {
  mounted: function () {
    var that = this;
    let userInfo = uni.getStorageSync("userInfo");
    uni.request({
      url: "http://redcrossadmin.isaw.top/api/message/GetMyMessages", //仅为示例，并非真实接口地址。
      data: {
        pageSize: 6,
      },
      method: "GET",
      header: {
        Authorization: userInfo.token,
      },
      success: (res) => {
        if (res.data.code == 1) {
          that.newsList = [];
          for (var i = 0; i < res.data.data.length; i++) {
            that.newsList.push(
              res.data.data[i].Title + " " + res.data.data[i].CreateTime
            );
          }
          //存储
        }
      },
    });
  },
  data() {
    return {
      //消息列表
      newsList: [],
    };
  },
};
</script>

<style lang="scss" scoped>
.content {
  margin: 0 20rpx 20rpx 20rpx;
  .u-notice-bar-wrap {
    border-radius: 10rpx !important;
  }
}
</style>
